setShareIdentityEnabled

Sets whether the identity of the launching app should be shared with the activity.

Use this option when starting an activity that needs to know the identity of the launching app; with this set to true, the activity will have access to the launching app's package name and uid.

Defaults to false if not set. This is a no-op before U.

Note, even if the launching app does not explicitly enable sharing of its identity, if the activity is started with Activity#startActivityForResult, then getCallingPackage will still return the launching app's package name to allow validation of the result's recipient. Also, an activity running within a package signed by the same key used to sign the platform (some system apps such as Settings will be signed with the platform's key) will have access to the launching app's identity.

Return

thisActivityOptions instance.

Parameters

shareIdentity

whether the launching app's identity should be shared with the activity

See also